package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantSchemeInfoMapper;
import com.hgkj.cloud.base.domain.TenantSchemeInfo;
import com.hgkj.cloud.base.domain.VO.UserDevReport;
import com.hgkj.cloud.base.service.TenantSchemeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TenantSchemeInfoServiceImpl implements TenantSchemeInfoService {

    @Autowired
    private TenantSchemeInfoMapper tenantSchemeInfoMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return tenantSchemeInfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TenantSchemeInfo record) {
        return tenantSchemeInfoMapper.insert(record);
    }

    @Override
    public int insertSelective(TenantSchemeInfo record) {
        return tenantSchemeInfoMapper.insertSelective(record);
    }

    @Override
    public TenantSchemeInfo selectByPrimaryKey(Long id) {
        return tenantSchemeInfoMapper.selectByPrimaryKey(id);
    }


    @Override
    public int updateByPrimaryKeySelective(TenantSchemeInfo record) {
        return tenantSchemeInfoMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TenantSchemeInfo record) {
        return tenantSchemeInfoMapper.updateByPrimaryKey(record);
    }

    @Override
    public int deleteSchemeInfo(Long id) {
        return tenantSchemeInfoMapper.deleteSchemeInfo(id);
    }

    @Override
    public TenantSchemeInfo selectSchemeDevInfo(Map<String, Object> map) {
        return tenantSchemeInfoMapper.selectSchemeDevInfo(map);
    }

    @Override
    public List<TenantSchemeInfo> listSchemeDevInfo(Long scheme_id) {
        return tenantSchemeInfoMapper.listSchemeDevInfo(scheme_id);
    }

    @Override
    public List<TenantSchemeInfo> listSchemeInfo(Map<String, Object> map) {
        return tenantSchemeInfoMapper.listSchemeInfo(map);
    }

    @Override
    public Map<String, Object> countSchemeRemainTimes(Long scheme_id) {
        return tenantSchemeInfoMapper.countSchemeRemainTimes(scheme_id);
    }

    @Override
    public Map<String, Object> countSchemeDevNums(Long scheme_id) {
        return tenantSchemeInfoMapper.countSchemeDevNums(scheme_id);
    }

    @Override
    public Long countTenantSchemeUnfinished(Map<String, Object> map) {
        return tenantSchemeInfoMapper.countTenantSchemeUnfinished(map);
    }

    @Override
    public List<UserDevReport> listDeviceReports(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantSchemeInfoMapper.listDeviceReports(map);
    }

    @Override
    public long countDeviceReports(Map<String, Object> map) {
        return tenantSchemeInfoMapper.countDeviceReports(map);
    }

    @Override
    public long countSubDeviceReports(Map<String, Object> map) {
        return tenantSchemeInfoMapper.countSubDeviceReports(map);
    }

    @Override
    public List<UserDevReport> listAllDeviceReports(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantSchemeInfoMapper.listAllDeviceReports(map);
    }

    @Override
    public long countAllDeviceReports(Map<String, Object> map) {
        return tenantSchemeInfoMapper.countAllDeviceReports(map);
    }

    @Override
    public List<UserDevReport> listUserDeviceReports(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantSchemeInfoMapper.listUserDeviceReports(map);
    }

    @Override
    public List<UserDevReport> listUserQueryReports(Map<String, Object> map) {
        return tenantSchemeInfoMapper.listUserQueryReports(map);
    }

    @Override
    public List<UserDevReport> getUserAllDevReport(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantSchemeInfoMapper.getUserAllDevReport(map);
    }

    @Override
    public Long getUserAllDevReportCount(Map<String, Object> map) {
        return tenantSchemeInfoMapper.getUserAllDevReportCount(map);
    }

    @Override
    public List<Map<String,Object>> getGroupSchemeInfoList(Map<String, Object> map) {
        return tenantSchemeInfoMapper.getGroupSchemeInfoList(map);
    }


}
